package com.briup.cms.service.impl;

import com.briup.cms.service.ICms_configService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class Cms_configServiceImpl implements ICms_configService {
    @Resource
    private Cms_configMapper cms_configMapper;

    @Override
    public List<Cms_config> findAll() {
        List<Cms_config> list=cms_configMapper.selectAll();
        return list;
    }

    @Override
    public void saveOrUpdate(Cms_config cms_config) {
        if(cms_config.getId()!=null){
            cms_configMapper.update(cms_config);
        } else {
            cms_configMapper.insert(cms_config);
        }
    }


   /* @Override
    public void save(Cms_config cms_config){
        cms_configMapper.insert(cms_config);
    }

    @Override
    public void update(Cms_config cms_config){
        cms_configMapper.update(cms_config);
    } */

    /*@Override
    public void saveOrUpdate(Cms_config cms_config) {
        if(cms_config.getId()!=null){
            cms_configMapper.update(cms_config);
        } else {
            cms_configMapper.insert(cms_config);
        }
    } */

    @Override
    public void deleteById(long id){
        cms_configMapper.deleteById(id);
    }
}
